local tunzi = fk.CreateSkill {
  name = "lingling__tunzi",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["lingling__tunzi"] = "屯辎",
  [":lingling__tunzi"] = "锁定技，摸牌阶段结束时，你获得一张【厉兵秣马】。",
}

tunzi:addEffect(fk.EventPhaseEnd, {
  anim_type = "drawcard",
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(tunzi.name) and player.phase == Player.Draw
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    local cards = room:getCardsFromPileByRule("groom_and_drill", 1, "allPiles")
    if #cards > 0 then
      room:moveCardTo(cards, Card.PlayerHand, player, fk.ReasonJustMove, tunzi.name, nil, true, player)
    end
  end,
})

return tunzi
